package com.pactera.asmp.server.dao;

import com.pactera.asmp.server.entity.MasterComputerDTO;
import com.pactera.asmp.server.entity.MasterComputerSearchDTO;
import com.pactera.asmp.server.entity.ProjectMasterDeviceVo;
import com.pactera.asmp.server.pojo.MasterComputer;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ProjectName: asmpserver
 * @Package: com.pactera.asmp.server.dao
 * @ClassName: MasterComputerMapper
 * @Author: lvzhiqiang
 * @Description: MasterComputerMapper
 * @Date: 2020/06/24 11:24
 * @Version: 1.0
 */
@Mapper
public interface MasterComputerMapper {


    int insert(MasterComputer masterComputer);

    int deleteByPrimaryKey(Integer id);

    int deleteByPrimaryKeys(List<Integer> datas);

    int update(MasterComputer masterComputer);
    int updateRegister(MasterComputerDTO masterComputer);

    int updateStatusByPrimaryKey(Integer id, Integer status);

    MasterComputer selectByPrimaryKey(Integer id);

    MasterComputer selectIdByCuid(@Param("cuid") String cuid, @Param("mac") String mac);

    List<MasterComputer> getMasterComputer(MasterComputerSearchDTO masterComputerSearchDTO);

    /**
     * 根据上位机 id 批量获取
     * @param list
     * @return
     */
    List<MasterComputer> findMasterComputerByIds(List<Integer> list);

    int updateNickName(MasterComputer masterComputer);

    List<MasterComputer> getMasterComputerByProjectId(@Param("projectId")Integer projectId);

    List<ProjectMasterDeviceVo> mastercBindByProjectId(@Param("projectId")Integer projectId);

    List<ProjectMasterDeviceVo> listBindByProjectId(@Param("projectId")Integer projectId, @Param("masterComputerId")Integer masterComputerId, @Param("projectIds")List<Integer> projectIds);

}
